
def is_valid_transaction(data: tuple) -> bool:
    if data[0] not in ('+', '-'):
        return False
    # if data[1]

    return True


def parse_transaction(user_input: str) -> tuple:
    """ Возвращает данные о транзакции в виде ['+'/'-', number, note] """
    import decimal as d
    pure_data = [t.strip("\t\b\n ")
                 for t in user_input.split(' ')
                 if len(t) > 0]
    profit, money, *note = pure_data
    money = d.Decimal(money)
    note = ' '.join(note) if note else ''
    return profit, money, note


assert parse_transaction('+ 100') == ('+', '100', '')
assert parse_transaction('- 100') == ('-', '100', '')
assert parse_transaction('- 100') == ('-', '100', '')
assert parse_transaction('- 100') == ('-', '100', '')
assert parse_transaction('- 100 sample note =)') == ('-',
                                                     '100', 'sample note =)')
assert parse_transaction(
    '+          100.100 sample           note') == ('+', '100.100', 'sample note')
